
<block name="content">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Form</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>
</head>
<style>

td{
      margin-top:10px;     
    
}
</style>
<body>
    <div id="form1" >
        <!--<input name="id" class="mini-hidden"  value="{$data.item_id}"/>-->
        <table cellspacing='10' style="width: 700px; border-spacing:0px 10px;" >

			 <tr>
                <td>
                    <label for="textbox1$text">平台编号：</label>
                </td>
                <td>
                    <input id="CardCode"  name="CardCode" class="mini-textbox" readonly  width='250px' value ="{$data.CardCode}"/>
                    <!--(建议命名规则:品牌+物料+型号)-->
                </td>
            </tr>

            <tr>
                <td>
                    <label for="textbox1$text">平台名称：</label>
                </td>
                <td>
                    <input  id="ShortName"  name="ShortName" class="mini-textbox" readonly  width='250px' value ="{$data.ShortName}"/>
                </td>
            </tr>
            
            
            <tr>
                <td>
                    <label for="textbox1$text">平台负责人：</label>
                </td>
                <td>
                    <input  id="CManager"  name="CManager" class="mini-textbox"  width='250px' value ="{$data.CManager}"/>
                </td>
            </tr>

            
             <tr>
                <td>
                    <label for="textbox1$text">平台类型：</label>
                </td>
                <td>
                
                <select name='ChannelType' id="ChannelType" class="form-control" >
                    <option value=''>请选择平台类型</option>
                    <option value='积分' <if condition="$data.ChannelType eq '积分' ">selected</if> >积分</option>
                    <option value='分期' <if condition="$data.ChannelType eq '分期' ">selected</if> >分期</option>
                    <option value='集采' <if condition="$data.ChannelType eq '集采' ">selected</if> >集采</option>
                </select>
                  
                    
                </td>
            </tr>

          

         
            
         
          
            
            
       
            
            
			<tr>
                <td>
                    
                </td>
                <td>
                

                    <a class='mini-button' onClick="save('{$data.CardCode}')" >保存</a>
                    
                    <!--CloseWindow()-->
                                                          
                    
                </td>
            </tr>
            
        </table>
    </div>
    <script type="text/javascript">
        mini.parse();
        function save(CardCode){
            //提交表单数据
          
          

            //save begin
//            if ($(".uploader .tbody").length > 0)  {
//            }
//            else {
//                mini.alert("必须上传相关附件！");
//                return;
//            }

            //确认提示
            mini.confirm("确定保存？", "确定？",
                function (action) {
                    if (action == "ok") {
                        //var data = form.getData();      //获取表单多个控件的数据
				          var CardCode = mini.get('CardCode').getValue();
						  var CManager = mini.get('CManager').getValue();
						  var  myselect=document.getElementById("ChannelType");
                          var index=myselect.selectedIndex ;             // selectedIndex代表的是你所选中项的index
						  var ChannelType=myselect.options[index].value;
						  
						  //var id = 999;
						  //var id = mini.get('id').getValue();
						  /*var product_spec = mini.get('product_spec').getValue();
						  var product_quality = mini.get('product_quality').getValue();
						  var sale_name = mini.get('sale_name').getValue();
						  var stock_number = mini.get('stock_number').getValue();
						  var stock_number = mini.get('stock_number').getValue();
						  var  myselect1=document.getElementById("enable");
                          var index1=myselect1.selectedIndex ;             // selectedIndex代表的是你所选中项的index
						  var enable=myselect1.options[index1].value;
						  var sap_item_code = mini.get('sap_item_code').getValue();*/
						  
                        $.ajax({
							url:"/index.php?m=&c=Platform&a=editingPlatform",
                            type: "post",
                            data: {CardCode: CardCode,CManager: CManager,ChannelType:ChannelType},
                            dataType: 'json',
                            success: function (data) {
								if(data.status)
								{
                                     mini.alert("更新成功");
								}else{
									 mini.alert("更新失败："+data.msg);
								}
                           
                            }
                        });

                    } else {
                    }
                });

           // save end

        }
     
		
   function CloseWindow(action) {

       if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
       else window.close();
	   //location.href=document.referrer;
    }

    </script>
   
</body>
</html>

</block>